<!--
 * @FilePath     : /study_code/layui/10-7.html
 * @Description  : 自定义内容
 * @Date         : 2025-02-17 13:34
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 10:46:22
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
    <style>
      .demo-dropdown-tabs {
        padding: 0 16px;
      }
    </style>
  </head>
  <body>
    <button class="layui-btn" id="ID-dropdown-demo-content">
      自定义内容
      <i class="layui-icon layui-icon-list layui-font-14"></i>
    </button>

    <script src="/layui/dist/layui.js"></script>
    <!-- <script src="/dropdown/common.js"></script> -->
    <script>
      layui.use(function () {
        var dropdown = layui.dropdown

        // 自定义内容
        dropdown.render({
          elem: '#ID-dropdown-demo-content',
          content: [
            '<div class="layui-tab layui-tab-brief">',
            '<ul class="layui-tab-title">',
            '<li class="layui-this">Tab header 1</li>',
            '<li>Tab header 2</li>',
            '<li>Tab header 3</li>',
            '</ul>',
            '<div class="layui-tab-content">',
            '<div class="layui-tab-item layui-text layui-show"><p style="padding-bottom: 10px;">在 content 属性中传入任意的 html 内容，可替代默认的下拉菜单结构，从而实现更多有趣的弹出内容。</p><p> 是否发现，dropdown 组件不仅仅只是一个下拉菜单或者右键菜单，它能被赋予许多的想象可能。</p></div>',
            '<div class="layui-tab-item">Tab body 2</div>',
            '<div class="layui-tab-item">Tab body 3</div>',
            '</div>',
            '</div>',
          ].join(''),
          className: 'demo-dropdown-tabs',
          style: 'width: 370px; height: 200px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);',
          // shade: 0.3, // 弹出时开启遮罩 --- 2.8+
          ready: function () {
            layui.use('element', function (element) {
              element.render('tab')
            })
          },
        })
      })
    </script>
  </body>
</html>
